package com.example.sunsg.okhttptest.greendao.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.example.sunsg.okhttptest.greendao.bean.Customer;
import com.example.sunsg.okhttptest.greendao.bean.Order;
import com.example.sunsg.okhttptest.greendao.bean.Student;
import com.example.sunsg.okhttptest.greendao.bean.Course;
import com.example.sunsg.okhttptest.greendao.bean.StudentCourse;
import com.example.sunsg.okhttptest.greendao.bean.PlayMusicCollection;

import com.example.sunsg.okhttptest.greendao.dao.CustomerDao;
import com.example.sunsg.okhttptest.greendao.dao.OrderDao;
import com.example.sunsg.okhttptest.greendao.dao.StudentDao;
import com.example.sunsg.okhttptest.greendao.dao.CourseDao;
import com.example.sunsg.okhttptest.greendao.dao.StudentCourseDao;
import com.example.sunsg.okhttptest.greendao.dao.PlayMusicCollectionDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig customerDaoConfig;
    private final DaoConfig orderDaoConfig;
    private final DaoConfig studentDaoConfig;
    private final DaoConfig courseDaoConfig;
    private final DaoConfig studentCourseDaoConfig;
    private final DaoConfig playMusicCollectionDaoConfig;

    private final CustomerDao customerDao;
    private final OrderDao orderDao;
    private final StudentDao studentDao;
    private final CourseDao courseDao;
    private final StudentCourseDao studentCourseDao;
    private final PlayMusicCollectionDao playMusicCollectionDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        customerDaoConfig = daoConfigMap.get(CustomerDao.class).clone();
        customerDaoConfig.initIdentityScope(type);

        orderDaoConfig = daoConfigMap.get(OrderDao.class).clone();
        orderDaoConfig.initIdentityScope(type);

        studentDaoConfig = daoConfigMap.get(StudentDao.class).clone();
        studentDaoConfig.initIdentityScope(type);

        courseDaoConfig = daoConfigMap.get(CourseDao.class).clone();
        courseDaoConfig.initIdentityScope(type);

        studentCourseDaoConfig = daoConfigMap.get(StudentCourseDao.class).clone();
        studentCourseDaoConfig.initIdentityScope(type);

        playMusicCollectionDaoConfig = daoConfigMap.get(PlayMusicCollectionDao.class).clone();
        playMusicCollectionDaoConfig.initIdentityScope(type);

        customerDao = new CustomerDao(customerDaoConfig, this);
        orderDao = new OrderDao(orderDaoConfig, this);
        studentDao = new StudentDao(studentDaoConfig, this);
        courseDao = new CourseDao(courseDaoConfig, this);
        studentCourseDao = new StudentCourseDao(studentCourseDaoConfig, this);
        playMusicCollectionDao = new PlayMusicCollectionDao(playMusicCollectionDaoConfig, this);

        registerDao(Customer.class, customerDao);
        registerDao(Order.class, orderDao);
        registerDao(Student.class, studentDao);
        registerDao(Course.class, courseDao);
        registerDao(StudentCourse.class, studentCourseDao);
        registerDao(PlayMusicCollection.class, playMusicCollectionDao);
    }
    
    public void clear() {
        customerDaoConfig.getIdentityScope().clear();
        orderDaoConfig.getIdentityScope().clear();
        studentDaoConfig.getIdentityScope().clear();
        courseDaoConfig.getIdentityScope().clear();
        studentCourseDaoConfig.getIdentityScope().clear();
        playMusicCollectionDaoConfig.getIdentityScope().clear();
    }

    public CustomerDao getCustomerDao() {
        return customerDao;
    }

    public OrderDao getOrderDao() {
        return orderDao;
    }

    public StudentDao getStudentDao() {
        return studentDao;
    }

    public CourseDao getCourseDao() {
        return courseDao;
    }

    public StudentCourseDao getStudentCourseDao() {
        return studentCourseDao;
    }

    public PlayMusicCollectionDao getPlayMusicCollectionDao() {
        return playMusicCollectionDao;
    }

}
